package com.aku.dao;

import com.aku.entity.Emp;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface EmpMapper {

    @Select("select * from tb_emp")
    List<Emp> selectAllEmp();

    @Select("select * from tb_emp where id=#{id}")
    Emp selectEmpByid(int id);

    @Insert("insert into tb_emp(name,age,entry_time,door_name,emp_call) values(#{name},#{age},now(),#{door_name},#{emp_call})")
    int insertEmp(Emp emp);

    @Update("update tb_emp set name=#{name},age=#{age},door_name=#{door_name},emp_call=#{emp_call} where id=#{id}")
    int updateEmp(Emp emp);

    @Delete("delete from tb_emp where id=#{id}")
    int deleteEmpById(int id);
}
